<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page import="com.tjsinfo.tjsoa.common.DealString"%>
<%@page import="com.tjsinfo.tjsoa.vote.vo.TVoteHead"%>
<%@page import="com.tjsinfo.tjsoa.vote.vo.TVoteColumn"%>
<%@page import="com.tjsinfo.tjsoa.vote.vo.TVoteConformation"%>
<%@page import="com.tjsinfo.tjsoa.vote.vo.TVoteEstimatedStatus;"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
	List<TVoteColumn> columnLists = (List) request.getAttribute("columnLists");
	List<TVoteConformation> conformationParentLists = (List) request.getAttribute("conformationParentLists");
	List<TVoteConformation> conformationLists = (List) request.getAttribute("conformationLists");
	TVoteHead head = (TVoteHead) request.getAttribute("head");
	TVoteEstimatedStatus estimatedStatus = (TVoteEstimatedStatus) request.getAttribute("estimatedStatus");
	DealString ds = new DealString();
	String title = head.getName();
	String name = estimatedStatus.getName();
	String post = estimatedStatus.getPost();
	String remark = head.getRemark();
	if (title.length() > 30)title = ds.substring(title, 30);
	if (name.length() > 10)name = ds.substring(name, 10);
	if (post.length() > 30)post = ds.substring(post, 30);
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<title>粮油集团办公自动化协作平台</title>
		<link href="<%=basePath%>style/txlz7.css" rel="stylesheet" type="text/css" />
		<link href="<%=basePath%>ajaxFramework/ext-2.1/resources/css/ext-all.css" rel="stylesheet" type="text/css" />
		<script type="text/javascript" src="<%=basePath%>ajaxFramework/ext-2.1/adapter/ext/ext-base.js"></script>
		<script type="text/javascript" src="<%=basePath%>ajaxFramework/ext-2.1/ext-all.js"></script>
		<script type="text/javascript" src="<%=basePath%>ajaxFramework/ext-2.1/source/locale/ext-lang-zh_CN.js"></script>
		<script type="text/javascript" src="<%=basePath %>ajaxFramework/jQuery/jquery.js"></script>
		<script type="text/javascript" src="<%=basePath %>js/common/global/validator.js"></script>
		<script type="text/javascript" src="<%=basePath %>js/common/global/pageControl.js"></script>
		<script type="text/javascript" src="<%=basePath %>js/common/system/selectusercheck.js"></script>		
		<style>
			.jkd1231 {
				border-left: 1px #d0d0d0 solid;
				border-bottom: 1px #d0d0d0 solid;
				margin: 16px auto;
			}
			
			.jkd1231 th {
				border-top: 1px #d0d0d0 solid;
				border-right: 1px #d0d0d0 solid;
				padding-top: 6px;
				padding-bottom: 6px;
				color: #666666;
				font-weight: bold;
				text-align: center
			}
			
			.jkd1231 td {
				border-top: 1px #d0d0d0 solid;
				border-right: 1px #d0d0d0 solid;
				height: 30px;
				color: #232323;
				text-align: left;
				padding-left: 3px
			}
		</style>
		<script type="text/javascript">
			function setValueKey(id,vk){
				document.getElementById('valueKey'+id).value=vk;
			}
			function sub(str){
			    var sub = "'您确认提交当前表单?'";
			    if(str==1){
			       sub = "'您确认放弃当前表单?'"
			       document.getElementById('valueSaveId').value="1";
			    }				
                Ext.MessageBox.confirm("提示信息",sub,function(btn){
  		           if(btn == 'yes'){
  			          msg();
			          form1.submit();
			          return;	
  		           }
                });
			}
	    </script>
	</head>
	<body>
		<div id="rightindex" style="height:97%">
			<div id="tab" style="width:97%">
				<div id="index_main">
					<div style="overflow-y: scroll; height: 99%;">
						<form name="form1" method="post" action="<%=basePath%>tjsinfo/tjsoa/vote/valueAdd.do?headId=<%=head.getId()%>&estimatedStatusId=<%=estimatedStatus.getId()%>">
							<table width="98%" border="0" cellspacing="0" cellpadding="0" class="jkd1231">
								<input type="hidden" name="valueSaveId" id="valueSaveId" value="0" />
								<tr>
									<th colspan="4">
										<%=title%>
									</th>
								</tr>
								<tr>
									<th width="17%">
										姓名
									</th>
									<td width="30%">
										<%=name%>
									</td>
									<th width="19%">
										职务
									</th>
									<td width="34%">
										<%=post%>
									</td>
								</tr>
								<%
									if (conformationParentLists.size() > 0) {
										for (int i = 0; i < conformationParentLists.size(); i++) {
								%>
								<tr>	
									<th rowspan="<%=conformationParentLists.get(i).getRowNum()%>">
										<%=conformationParentLists.get(i).getName()%>
									</th>
									<%
										         for (int j = 0; j < conformationLists.size(); j++) {
													  String radioId = conformationLists.get(j).getId().toString();
													  String a = conformationParentLists.get(i).getId();
													  String b = conformationLists.get(j).getParentId();
													  if (a.equals(b)) {
														  int f = 1;
									%>
									<td colspan="1">
										<%=conformationLists.get(j).getName()%>
									</td>
									<td colspan="2">
										<%
											              for (int k = 0; k < columnLists.size(); k++) {
															   String c = conformationParentLists.get(i).getId();
															   String d = columnLists.get(k).getConId();
															   if (c.equals(d)) {
										%>
										<label>
											<input type="radio" name="<%=radioId%>" checked="checked" id="<%=radioId%>" value="<%=columnLists.get(k).getId()%>" onclick="setValueKey('<%=radioId%>',this.value);" />
										</label>
										<%=columnLists.get(k).getName()%>&nbsp;
										<%
											                       f = k;
																}
															}
										%>
										<input type="hidden" name="valueKey<%=radioId%>" id="valueKey<%=radioId%>" value="<%=columnLists.get(f).getId()%>" />
									</td>
								</tr>
								<%
									                  }
											     }
								%>
								<%
									         }
									    }
								%>
								<tr>
									<th>
										备注
									</th>
									<td colspan="3">
										<textarea name="textarea3" id="textarea3" cols="68" rows="4" style="border: 1px #ddd solid; background: #F4F4F4"><%=remark%></textarea>
									</td>
								</tr>
							</table>
							<table width="700" border="0" cellspacing="0" cellpadding="0">
								<tr>
									<td width="217" height="30" align="left" valign="middle">
										&nbsp;
									</td>
									<td width="79" align="center" valign="middle">
										<a onclick="sub(0);" style="cursor: hand">提交</a>
									</td>
									<td width="15">
										&nbsp;
									</td>
									<td width="79" align="center" valign="middle">
										<a onclick="sub(1);" style="cursor: hand">弃权</a>
									</td>
									<td width="15">
										&nbsp;
									</td>
									<td width="79" align="center" valign="middle">
										<a href="<%=basePath%>tjsinfo/tjsoa/vote/estimatedStatusList.do?headId=<%=head.getId()%>">返回</a>
									</td>
									<td width="216" align="center" valign="middle">
										&nbsp;
									</td>
								</tr>
							</table>
						</form>
					</div><div class="clear"></div>
				</div>
			</div>
		</div>
	</body>
</html>
